package cn.com.yusys.yusp;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.core.env.Environment;

import com.ctrip.framework.apollo.spring.boot.ApolloAutoConfiguration;
import com.ulisesbocchio.jasyptspringboot.JasyptSpringBootAutoConfiguration;

import cn.com.yusys.yusp.commons.config.ActuatorWebAppConfig;
import cn.com.yusys.yusp.commons.config.ApplicationProperties;
import cn.com.yusys.yusp.commons.util.AppStartMessageUtil;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * 2.1.x版本精简启动类代码<br/>
 * 该项目如需要使用属性加解密功能，请将该类的SpringBootApplication注解中exclude属性中的{@link JasyptSpringBootAutoConfiguration}删除即可
 * 
 * @since 2019年1月28日 下午3:05:58
 * @version 1.0
 */
@EnableConfigurationProperties({ApplicationProperties.class})
@SpringBootApplication(scanBasePackages = { "cn.com.yusys.yusp"},
		exclude = {JmxAutoConfiguration.class, SecurityAutoConfiguration.class, 
        JasyptSpringBootAutoConfiguration.class, ApolloAutoConfiguration.class, ActuatorWebAppConfig.class})
@MapperScan(basePackages = { "cn.com.yusys.yusp.**.repository.mapper"})
@ServletComponentScan
public class SingleServiceApplication {
    
    private static final Logger log = LoggerFactory.getLogger(SingleServiceApplication.class);

    public static void main(String[] args) {
        Environment env = SpringApplication.run(SingleServiceApplication.class, args).getEnvironment();
        log.info(AppStartMessageUtil.updServiceStartMessage(env));
    }
}
